// 封装和图片相关的请求

import axios from '@/utils/request'

// 获取图片素材
export const getImages = params => {
  return axios({
    method: 'GET',
    url: '/mp/v1_0/user/images',
    // Body 参数使用data 设置
    // Query 参数使用 params 设置
    // Headers 参数使用 headers 设置
    params
  })
}

// 收藏图片
export const targetImages = (id, collect) => {
  return axios({
    method: 'put',
    url: `/mp/v1_0/user/images/${id}`,
    data: {
      collect
    }
  })
}

// 删除图片
export const deleteImages = (id) => {
  return axios({
    method: 'delete',
    url: `/mp/v1_0/user/images/${id}`
  })
}

// 上传图片
export const uploadImages = (file) => {
  return axios({
    method: 'post',
    url: '/mp/v1_0/user/images',
    data: file
  })
}
